package com.youkeda.dewu.dataobject;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.youkeda.dewu.model.Product;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * product
 * @author 
 */
@Data
public class ProductDO implements Serializable {
    private String id;

    /**
     * 商品名称
     */
    private String name;

    /**
     * 参考价格
     */
    private Double price;

    /**
     * 商品销量
     */
    private Integer purchaseNum;

    /**
     * 商品介绍
     */
    private String productIntro;

    /**
     * 商品轮播图
     */
    private String productImgs;

    private LocalDateTime gmtCreated;

    private LocalDateTime gmtModified;

    private static final long serialVersionUID = 1L;

    public ProductDO() {
    }
    public ProductDO(Product product){
        BeanUtils.copyProperties(product,this);
    }
    public Product toModel(){
        Product product = new Product();
        BeanUtils.copyProperties(this,product);
        return product;
    }
}